﻿using System;
using System.Collections.Generic;
using System.Text;
using DeepHash.Document;
using DeepHash.CommandParser;

namespace DeepHash.Run
{
    class LiveCompareCommand : CommandBase
    {
        public LiveCompareCommand ():base("live"){}

        private string _path1 = string.Empty;
        [CommandParameter("path1")]
        public string Path1
        {
            get { return _path1; }
            set { _path1 = value; }
        }

        private string _path2 = string.Empty;
        [CommandParameter("path2")]
        public string Path2
        {
            get { return _path2; }
            set { _path2 = value; }
        }


        public override void Execute()
        {
            DirectoryWalker walker1 = new DirectoryWalker();
            VerificationDocument doc1 = walker1.WalkDirectory(this.Path1, new MD5HashAlgorithem(),
                true, null);

            DirectoryWalker walker2 = new DirectoryWalker();
            VerificationDocument doc2 = walker2.WalkDirectory(this.Path2, new MD5HashAlgorithem(),
                true, null);

            DocumentComparer comparer = new DocumentComparer(doc1, "Reference", doc2, "Target   ");
            comparer.Compare();
        }
    }
}
